#!/bin/sh
echo 'stopping existing container...'
docker stop nginx
echo 'removing existing container...'
docker rm nginx
echo 'configurating container...'
rm -rf /mnt/xvdf/container/nginx
cp -r ./nginx /mnt/xvdf/container/
cp -r /mnt/xvdf/ssl /mnt/xvdf/container/nginx/
echo 'starting service...'
docker pull binbinxm/ubuntu:nginx
docker run -dt -v /mnt/xvdf/container/nginx:/mnt -p 443:443 --net=web_backend --name=nginx --restart=always binbinxm/ubuntu:nginx zsh -c '/mnt/startup.sh'

